// import Mock from 'mockjs';
import Router from 'koa-router';
import proxyService from '../../common/proxyService';
import {
  getSnewsList, // 获取消息列表
  getSnewsDetail, // 获取消息详情
  getSnewsNum, // 获取未读消息数
} from '../../api';

const router = new Router();

// 获取消息列表
router.get('/getSnewsList', async ctx => {
  const response = await proxyService.postProxy(ctx, getSnewsList);
  return (ctx.body = response);
});

// 获取消息详情
router.get('/getSnewsDetail', async ctx => {
  const response = await proxyService.postProxy(ctx, getSnewsDetail);
  return (ctx.body = response);
});

// 获取未读消息
router.get('/getSnewsNum', async ctx => {
  const response = await proxyService.postProxy(ctx, getSnewsNum);
  return (ctx.body = response);
});

export default router;
